<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>入职管理</title>
<script type="text/javascript" src="static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/easyui/themes/metro/easyui.css">
	<style type="text/css">
		/* 待入职的信息 */
		.qdrz{
			color: #19AA8D;
			border:1px solid #1AB394;
		}
		.fqrz{
			color: #19AA8D;
			border:1px solid #1AB394;
		}
		.ruzhi-sc{
			color: #19AA8D;
			border:1px solid #1AB394;
		}
		/* 入职审批的信息 */
		.rz-ck{
			color: #19AA8D;
			border:1px solid #1AB394;
		}
		/* 入职审批结果查看 */
		.jieguo-ck{
			color: #19AA8D;
			border:1px solid #1AB394;
		}
	</style>
</head>
<body>
 <script type="text/javascript">
function add(text){
	$("#content-admin").panel({
		href:text
	});
}
function addentry(){
	add("ljj-entry-add");
}
	$(function(){
		 $('#entry-sp').datagrid({
		    url:'entry-list',
		    columns:[[
				{field:'entryid',title:'入职编号',width:100,align:'center'},
				{field:'entyensourrce',title:'来源',width:150,align:'center'},
				{field:'entystate',title:'审批状态',width:150,align:'center'},
				{field:'entytime',title:'提交时间',width:150,align:'center'},
				{field:'staff_name',title:'员工名称',width:150,align:'center'},
				{field:'staff_sex',title:'性别',width:150,align:'center'},
				{field:'staff_sfzz',title:'是否在职',width:150,align:'center'},
				{field:'depart_name',title:'部门名称',width:150,align:'center'},
				{field:'caozuo',title:'操作',width:250,align:'center',
					formatter: function(value,row,index){
						return "<input type='button' style='width: 45px;height: 20px;font-size:12px;border-radius:4px;margin-right:5px;color:#fff;background-color:#18A689;border:1px solid #18A689;' value='查看'/>"+"<input type='button' onclick='shenhe("+row['entryid']+")' style='width: 80px;height: 20px;font-size:12px;border-radius:4px;margin-right:5px;color:#fff;background-color:#18A689;border:1px solid #18A689;' value='点击审核'/>";
					},
				}
		    ]],
		    pagination:true,
		    pageNumber:1,
		    pageSize:5,
		    pageList:[5,10,15]
		});
		//入职审核ajax
		$("#qd-entry").linkbutton({onClick : function(){
			alert($("#entryid").textbox("getValue"));
			alert($("#staffId").textbox("getValue"));
			  $.ajax({
		         type:"post",//type可以为post也可以为get
		         url:"ruzhi-shenhe",
		         data:{Entryid:$("#entryid").textbox("getValue"),
		        	   staffId:$("#staffId").textbox("getValue")
		        	   },
		         success:function(data){
		        	 $("#entry-sp").datagrid("reload");
		             $("#entry-shenhe").window("close");
		         }
		     });
			
		}});  
	});
	function shenhe(entryid){
		alert(entryid);
		$("#shrz-form").form('load','chaxun-shenhe?entryid='+entryid);
		$("#entry-shenhe").window("open");
		$("#entry-gb").linkbutton({onClick : function(){
			$("#entry-shenhe").window("close");
		}});
	}
	</script>
		<a id="xz-drz" onClick="addentry()" class="easyui-linkbutton"  data-options="iconCls:'icon-add'">新增待入职</a>
			<table id="entry-sp" class="easyui-datagrid" style="height: 500px;">   
			</table>  
<!-- 审核窗口 -->
 <div id="entry-shenhe" class="easyui-window" title="入职审核" style="width:800px;height:300px;" 
		data-options="modal:true,collapsible:false,minimizable:false,maximizable:false,closed:true,draggable:false">
			<Form  action="xiugai-contract" id="shrz-form" method="post">
		        	<table width="600px" style="padding: 5px 5px 2px 3px;height:130px;">
		        		<tr>
		        			<td><input id="entryid"  name="entryid" class="easyui-textbox" data-options="label:'入职编号',width:280,labelAlign:'right',required:true"/></td>
		        			<td><input  name="entyensourrce" class="easyui-textbox" data-options="label:'来源',width:280,labelAlign:'right',required:true,editable:false"/></td>
		        		</tr>
		        		<tr>
		        			<td><input id="staffId"   name="staffId" class="easyui-textbox"  data-options="label:'员工工号',width:280,labelAlign:'right',required:true"/></td>
		        			<td><input   name="staff_name" class="easyui-textbox"  data-options="label:'员工名称',width:280,labelAlign:'right',required:true"/></td>
						</tr>
						<tr>
							<td><input   name="staff_sex" class="easyui-textbox"  data-options="label:'性别',width:280,labelAlign:'right',required:true"/></td>
		        			<td><input id="staff_sfzz"   name="staff_sfzz" class="easyui-textbox"  data-options="label:'是否在职',width:280,labelAlign:'right',required:true"/></td>
						</tr>
		        		<tr>
		        			<td><input   name="depart_name" class="easyui-textbox"  data-options="label:'部门名称',width:280,labelAlign:'right',required:true"/></td>
		        			<td><input  name="entytime" class="easyui-datebox" data-options="label:'入职时间',width:280,labelAlign:'right',required:true,editable:false"/></td>
						</tr>
						<tr>
							<td><input id="entystate"  name="entystate" class="easyui-textbox"  data-options="label:'审核状态',width:280,labelAlign:'right',required:true"/></td>
						</tr>
		        	</table>
		        	<div style="text-align: center;margin: 10px 1px 1px 1px">
					<a id="entry-gb" class="easyui-linkbutton" data-options="width:100">关闭</a>
					<a id="qd-entry"  class="easyui-linkbutton" data-options="width:100">确定</a>
					</div>
				 </Form>
		</div>
</body>
</html>